From: Sebastian Keller Date: Fri, 30 Jan 2026 14:43:09 +0000 (+0100) Subject: environment: Add fallback for MetaIdleMonitor::add_idle_watch_full() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~32^2~5^2^2~24 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=bdca0be97a2002ab89a606ece1e9da4648909339;p=gnome-shell.git environment: Add fallback for MetaIdleMonitor::add_idle_watch_full() This function was only added in the 50 cycle and then backported to stable releases, so it might not exist in the version of mutter we are using. Part-of: --- diff --git a/js/ui/environment.js b/js/ui/environment.js index 93e0bdbd0..3ebe8e261 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -338,6 +338,20 @@ Clutter.Actor.prototype.toString = function () { return St.describe_actor(this); }; +if (!Meta.IdleMonitor.prototype.add_idle_watch_full) { + Meta.IdleMonitorWatchFlags = { + NONE: 0, + UNINHIBITABLE: 1, + START_NOW: 2, + }; + + Meta.IdleMonitor.prototype.add_idle_watch_full = function (interval, callback, flags = 0) { + if (flags !== 0) + console.warn('IdleMonitor does not support flags, the watch will not work as expected'); + this.add_idle_watch(interval, callback); + }; +} + Gio.File.prototype.touch_async = function (callback) { Shell.util_touch_file_async(this, callback); };